<!doctype html>
<html>
<head>
</head>
<body>
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
?>

<!-- JavaScript -->
<script type="text/javascript" src="<?php echo base_url() ?>js/wufoo.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>js/zebra_datepicker.js"></script>

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/chosen.css" media="screen, tv, projection" title="Default" />
<link rel="stylesheet" href="<?php echo base_url() ?>css/zebra_datepicker_metallic.css" type="text/css">


<div id="container">
    <?php
    //Setting Value pada form Jika melakukan prosedur Edit terhadap data tertentu.
    if($status == "edit"){
        foreach($arsip as $row){
            $value['arsip_tahun'] = $row->ARSIP_TAHUN;
            $value['arsip_id'] = $row->ARSIP_ID;
            $value ['arsip_kode'] = $row->ARSIP_KODE;
            $value ['arsip_organisasi'] = $row->ARSIP_ORGANISASI;
            $value ['arsip_jenis'] = $row->ARSIP_JENIS;
            $value ['arsip_klasifikasi'] = $row->ARSIP_KLASIFIKASI;
            $value ['arsip_nomor'] = $row->ARSIP_NOMOR;
            $value ['arsip_tanggal'] = $row->ARSIP_TANGGAL;
            $value ['arsip_judul'] = $row->ARSIP_JUDUL;
            $value ['arsip_katakunci'] = $row->ARSIP_KATAKUNCI;
            $value ['arsip_ringkasan'] = $row->ARSIP_RINGKASAN;
            $value ['arsip_sifat'] = $row->ARSIP_SIFAT;
            $value ['arsip_kota'] = $row->ARSIP_KOTA;
            $value ['arsip_jabatan'] = $row->ARSIP_JABATAN;
            $value ['arsip_pejabat'] = $row->ARSIP_PEJABAT;
        }
        $value['legend'] = "Form Edit Arsip";
        $value['info'] = "Form Edit Data Arsip";
        $value['act_form'] = "arsip/edit_arsip/".$value['arsip_tahun'].$value['arsip_id'];
    }//end if

    else
    {
        //Setting Awal Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
        $value = array(
        'error'             => "",
        'legend'            => "Form Input Arsip",
        'info'              => "Form entri data arsip",
        'act_form'          => "arsip/input_arsip/",
        'arsip_tahun'       => "",
        'arsip_id'          => "",
        'arsip_kode'        => "",
        'arsip_organisasi'  => "",
        'arsip_jenis'       => "",
        'arsip_klasifikasi' => "",
        'arsip_nomor'       => "",
        'arsip_tanggal'     => "",
        'arsip_judul'       => "",
        'arsip_katakunci'   => "",
        'arsip_ringkasan'   => "",
        'arsip_sifat'       => "",
        'arsip_kota'        => "",
        'arsip_jabatan'     => "",
        'arsip_pejabat'     => ""

    );
    }
    
    ?>
    <?= form_open_multipart($value["act_form"],'class="wufoo" name="form_arsip"'); ?>
    <fieldset class="fieldset">
    <legend class="legend">
        <?= $value["legend"] ?> |
    </legend>
    
    <div class="info">
        <div><?= $value["info"] ?></div>
    </div>
    <div>
        <?= anchor(site_url('arsip'),img(array('src'=>'images/main/38.png','border'=>'0','alt'=>'')).'Kembali ke daftar arsip','Menampilkan halaman Daftar Arsip'); ?>
    </div>
  

 <!-- Konten -------------------------------------------------------------------------->
 <div id="contentform">
 <?php $atrib='style="width:250px"; id="arsip_tahun" class="chzn-select field"'?>
 <?php $atrib_jenis='style="width:250px"; id="arsip_jenis" class="chzn-select field"'?>
 <?php $atrib_organisasi='style="width:250px"; id="arsip_organisasi" class="chzn-select field"'?>
 <?php $atrib_lokasi='style="width:250px"; id="arsip_lokasi" class="chzn-select field"'?>
 <?php $atrib_klasifikasi='style="width:250px"; id="arsip_klasifikasi" class="chzn-select field"'?>

 <table border="0" width="100%" cellpadding="0" cellspacing="0">
 <tr valign="top">
 <td style="padding:10px;width:40%;">
    <ul>
        <li>
                    <label class="desc">Tahun *</label>
                        <div>
                                <?php
                                //list tahun
                                echo form_dropdown('arsip_tahun',$options,set_value('arsip_tahun'),$atrib); 
                                ?>
                        </div>
                    <?php echo form_error('arsip_tahun'); ?>
                </li>

        <li>
            <label class="desc">ID ARSIP *</label>
            <div>
                <input type="text" name="arsip_id" class="new field" value="<?php if($value['arsip_id'] !='') {echo $value['arsip_id'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_id');?>

        <li>
            <label class="desc">KODE ARSIP *</label>
            <div>
                <input type="text" name="arsip_kode" class="new field" value="<?php if($value['arsip_kode'] !='') {echo $value['arsip_kode'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_kode'); ?>

        <li>
            <label class="desc">ORGANISASI</label>
                <div>
                    <?php
                        //list tahun
                        echo form_dropdown('arsip_organisasi',$organisasi_options,set_value('arsip_organisasi'),$atrib_organisasi); 
                    ?>
                </div>
        </li>
        <?php echo form_error('arsip_organisasi'); ?>

        <li>
            <label class="desc">JENIS ARSIP </label>
            <div>
                    <?php
                        //list tahun
                        echo form_dropdown('arsip_jenis',$jenis_options,set_value('arsip_jenis'),$atrib_jenis); 
                    ?>
                </div>
        </li>
        <?php echo form_error('arsip_jenis'); ?>

        <li>
            <label class="desc">KLASIFIKASI ARSIP </label>
            <div>
                    <?php
                        //list tahun
                        echo form_dropdown('arsip_klasifikasi',$klasifikasi_options,set_value('arsip_klasifikasi'),$atrib_klasifikasi); 
                    ?>
                </div>
        </li>
        <?php echo form_error('arsip_klasifikasi'); ?>

        <li>
            <label class="desc">NOMOR ARSIP </label>
            <div>
                <input type="text" name="arsip_nomor" class="new field" value="<?php if($value['arsip_nomor'] !='') {echo $value['arsip_nomor'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_nomor'); ?>

        <li>
            <label class="desc">TANGGAL ARSIP </label>
            <div>
                <input type="text" name="arsip_tanggal" class="calendar field" value="<?php if($value['arsip_tanggal'] !='') {echo $value['arsip_tanggal'];}else {echo '';}?>"/>
            </div>
        </li>
        <?php echo form_error('arsip_tanggal'); ?>
    </ul>

    </td>
    <td style="padding:10px; width:40%;">
    <ul>

        <li>
            <label class="desc">JUDUL ARSIP </label>
            <div>
                <input type="text" name="arsip_judul" class="new field" value="<?php if($value['arsip_judul'] !='') {echo $value['arsip_judul'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_judul'); ?>     

        <li>
            <label class="desc">KATA KUNCI </label>
            <div>
                <input type="text" name="arsip_katakunci" class="new field" value="<?php if($value['arsip_katakunci'] !='') {echo $value['arsip_katakunci'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_katakunci'); ?>

        <li>
            <label class="desc">RINGKASAN </label>
            <div>
                <input type="text" name="arsip_ringkasan" class="new field" value="<?php if($value['arsip_ringkasan'] !='') {echo $value['arsip_ringkasan'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_ringkasan'); ?>

        <li>
            <label class="desc">SIFAT </label>
            <div>
                <input type="text" name="arsip_sifat" class="new field" value="<?php if($value['arsip_sifat'] !='') {echo $value['arsip_sifat'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_sifat'); ?>

        <li>
            <label class="desc">KOTA </label>
            <div>
                <input type="text" name="arsip_kota" class="new field" value="<?php if($value['arsip_kota'] !='') {echo $value['arsip_kota'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_kota'); ?>

        <li>
            <label class="desc">JABATAN </label>
            <div>
                <input type="text" name="arsip_jabatan" class="new field" value="<?php if($value['arsip_jabatan'] !='') {echo $value['arsip_jabatan'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_jabatan'); ?>

        <li>
            <label class="desc">PEJABAT </label>
            <div>
                <input type="text" name="arsip_pejabat" class="new field" value="<?php if($value['arsip_pejabat'] !='') {echo $value['arsip_pejabat'];}else {echo '';}?>" required/>                         
            </div>
        </li>
        <?php echo form_error('arsip_pejabat'); ?>
                
        <li class="buttons">
          
          <input id="submit" type="submit" value="Simpan" />
          <input id="reset" type="reset" value="Batal" />
        </li>
    </ul>
    </td>
    </tr>
    </table>
</div>
</fieldset>
<?= form_close(); ?>
</form>
<script type="text/javascript" src="<?= base_url() ?>js/chosen.jquery.js"></script>
<script type="text/javascript">
    $(".chzn-select").chosen({no_results_text: "Data yang dicari tidak ditemukan"});

    $(document).ready(function() {

    $('input.calendar').Zebra_DatePicker(
    {
    format:'d/m/Y'
    });

 });
</script>
</div><!--container-->
</body>
</html>